<template>
	<a-card :bordered="false">
        <!-- 查询区域 -->
        <div class="table-page-search-wrapper">
            <a-form layout="inline" @keyup.enter.native="searchQuery">
                <a-row :gutter="24">
                </a-row>
            </a-form>
        </div>
        <!-- 查询区域-END -->

        <!-- 操作按钮区域 -->
        <div class="table-operator">
            <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
        </div>
		
		<!-- table区域-begin -->
		<div>
			<a-table ref="table" size="middle" :scroll="{ x: true }" :columns="columns" :dataSource="dataSource"
				:pagination="ipagination" :loading="loading"
				@change="handleTableChange">

				<template slot="htmlSlot" slot-scope="text">
					<div v-html="text"></div>
				</template>
				<template slot="imgSlot" slot-scope="text,record">
					<span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
					<img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt=""
						style="max-width:80px;font-size: 12px;font-style: italic;" />
				</template>
				<template slot="fileSlot" slot-scope="text">
					<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
					<a-button v-else :ghost="true" type="primary" icon="download" size="small" @click="downloadFile(text)">
						下载
					</a-button>
				</template>

				<span slot="action" slot-scope="text, record">
					<a @click="handleEdit(record)">编辑</a>

					<a-divider type="vertical" />
					<a-dropdown>
						<a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
						<a-menu slot="overlay">
							<a-menu-item>
								<a @click="handleDetail(record)">详情</a>
							</a-menu-item>
							<a-menu-item>
								<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
									<a>删除</a>
								</a-popconfirm>
							</a-menu-item>
						</a-menu>
					</a-dropdown>
				</span>

			</a-table>
		</div>

		<cy-platform-config-org-state-and-role-type-modal ref="modalForm"
			@ok="modalFormOk"></cy-platform-config-org-state-and-role-type-modal>
	</a-card>
</template>

<script>

import '@/assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import CyPlatformConfigOrgStateAndRoleTypeModal from './permissionModule/CyPlatformConfigOrgStateAndRoleTypeModal.Style#Drawer.vue'
import { filterDictTextByCache } from '@/components/dict/JDictSelectUtil';

export default {
	name: 'OrgStateAndRoleTypeList',
	mixins: [JeecgListMixin, mixinDevice],
	components: {
		CyPlatformConfigOrgStateAndRoleTypeModal
	},
	data() {
		return {
			description: '组织状态与权限关联管理页面',
			// 表头
			columns: [
				{
					title: '状态',
					align: "center",
					dataIndex: 'state',
					customRender: (text) => {
						return filterDictTextByCache('organization_state', text)
					}
				},
				{
					title: '组织类型',
					align: "center",
					dataIndex: 'orgType',
					customRender: (text) => {
						return filterDictTextByCache('org_type', text)
					}
				},
				{
					title: '备注说明',
					align: "center",
					dataIndex: 'remark',
					width: 150,
					ellipsis: true,
				},
				{
					title: '操作',
					dataIndex: 'action',
					align: "center",
					fixed: "right",
					width: 147,
					scopedSlots: { customRender: 'action' }
				}
			],
			url: {
				list: "/platform/config/cyPlatformConfigOrgStateAndRoleType/list",
				delete: "/platform/config/cyPlatformConfigOrgStateAndRoleType/delete",
				deleteBatch: "/platform/config/cyPlatformConfigOrgStateAndRoleType/deleteBatch",
				exportXlsUrl: "/platform/config/cyPlatformConfigOrgStateAndRoleType/exportXls",
				importExcelUrl: "platform/config/cyPlatformConfigOrgStateAndRoleType/importExcel",

			},
			dictOptions: {},
			superFieldList: [],
		}
	},
	created() {
	},
	computed: {
		importExcelUrl: function () {
			return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
		},
	},
	methods: {
		filterDictTextByCache,
	}
}
</script>
<style lang="less"></style>